package org.budo.cmbc.sdk.entity;

import java.util.Date;

import org.budo.cmbc.sdk.impl.AbstractCmbcSdk;
import org.budo.time.Time;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * @author lmw
 */
@Getter
@Setter
@Accessors(chain = true)
@ToString
public class QryDtlRequest extends AbstractCmbcRequest {
    private static final long serialVersionUID = -2118255730426561089L;

    private String trnId;

    private String acntNo;

    private String dateFrom;

    private String dateTo;

    private Integer startNo;

    private Integer endNo;

    private String typeCode;

    public QryDtlRequest() {
        super();

        this.setDateTo(Time.now().toString(AbstractCmbcSdk.DATE_FORMAT)); // 现在
        this.setTrnId("CMBC_" + Time.now().toString(DATE_FORMAT_2));
    }

    public QryDtlRequest setDateFrom(String dateFrom) {
        this.dateFrom = dateFrom;
        return this;
    }

    public QryDtlRequest setDateFrom(Date dateFrom) {
        this.dateFrom = Time.when(dateFrom).toString(AbstractCmbcSdk.DATE_FORMAT);
        return this;
    }
}